[−][src]Crate humantime
Human-friendly time parser and formatter
Features:
- Parses durations in free form like
15days 2min 2s
- Formats durations in similar form
2years 2min 12us
- Parses and formats timestamp in
rfc3339
format:2018-01-01T12:53:00Z
- Parses timestamps in a weaker format:
2018-01-01 12:53:00
Timestamp parsing/formatting is super-fast because format is basically fixed.
See serde-humantime for serde integration.
Structs
Duration | A wrapper for duration that has |
FormattedDuration | A wrapper type that allows you to Display a Duration |
Rfc3339Timestamp | A wrapper type that allows you to Display a SystemTime |
Timestamp | A wrapper for SystemTime that has |
Enums
DurationError | Error parsing human-friendly duration |
TimestampError | Error parsing datetime (timestamp) |
Functions
format_duration | Formats duration into a human-readable string |
format_rfc3339 | Format an RFC3339 timestamp |
format_rfc3339_micros | Format an RFC3339 timestamp |
format_rfc3339_millis | Format an RFC3339 timestamp |
format_rfc3339_nanos | Format an RFC3339 timestamp |
format_rfc3339_seconds | Format an RFC3339 timestamp |
parse_duration | Parse duration object |
parse_rfc3339 | Parse RFC3339 timestamp |
parse_rfc3339_weak | Parse RFC3339-like timestamp |